package com.teprinciple.wanandroid.ui.page

import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.viewinterop.AndroidView
import androidx.compose.runtime.getValue

@Composable
fun WebPage(){

    val url by remember{
        mutableStateOf("https://www.baidu.com")
    }

    AndroidView(factory = {
        WebView(it).apply {
            webChromeClient = WebChromeClient()
            webViewClient = WebViewClient()
            overScrollMode = WebView.OVER_SCROLL_NEVER
            loadUrl(url)
        }
    }, modifier = Modifier.fillMaxSize(), update = {
//        it.loadUrl(url)
    })
}